#pragma once
#include "envoy/common/pure.h"

#include "external/envoy/source/common/common/statusor.h"
#include "external/envoy/source/common/protobuf/protobuf.h"

#include "api/client/options.pb.h"
#include "api/client/service.grpc.pb.h"

namespace Nighthawk {

/**
 * An interface for a stateless helper that interacts with a Nighthawk Service gRPC stub.
 */
class NighthawkServiceClient {
public:
  virtual ~NighthawkServiceClient() = default;

  /**
   * Runs a single benchmark using a Nighthawk Service.
   *
   * @param nighthawk_service_stub Nighthawk Service gRPC stub.
   * @param command_line_options Nighthawk Service benchmark request proto generated by the
   * StepController, without the duration set.
   *
   * @return StatusOr<ExecutionResponse> If we reached the Nighthawk Service, this is the raw
   * ExecutionResponse proto, containing the benchmark data or possibly an error message from
   * Nighthawk Service; if we had trouble communicating with the Nighthawk Service, we return an
   * error status.
   */
  virtual absl::StatusOr<nighthawk::client::ExecutionResponse> PerformNighthawkBenchmark(
      nighthawk::client::NighthawkService::StubInterface* nighthawk_service_stub,
      const nighthawk::client::CommandLineOptions& command_line_options) const PURE;
};

} // namespace Nighthawk
